<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h3 id='h3'></h3>
    <input type="text" id='input' />
    <script>
        let obj=[];
        obj = new Proxy(obj,{
            get(target,prop){
                return target[prop];
            },
            set(target,prop,value){
                target[prop] = value;
                observer();
            }
        })
        function observer(){
            document.getElementById('h3').innerText = obj[0];
            document.getElementById('input').value = obj[0];
        };
        document.getElementById('input').oninput = function(e) {
            obj[0] = e.target.value;
        }
    </script>
</body>
</html>